package me.jiatao.wan.di

import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import me.jiatao.wan.data.database.AppDataBase
import me.jiatao.wan.data.network.api.WanAndroidApi
import me.jiatao.wan.data.repository.Repository
import me.jiatao.wan.data.repository.RepositoryFactory
import javax.inject.Singleton

/**
 * @Author: taojia
 * @CreateDate: 2021/8/24 4:17 下午
 * @Version: 1.0
 * @Description:
 */

@Module
@InstallIn(SingletonComponent::class)
object RepositoryModule {
    @Singleton
    @Provides
    fun provideRepository(
        api: WanAndroidApi,
        db: AppDataBase
    ): Repository {
        return RepositoryFactory.makePokemonRepository(api, db)
    }
}